package com.seedwill.common.meta.source;

import java.io.Serializable;

import com.seedwill.common.meta.IData;

/**
 * 单一数据源
 * 从数据库中取出单条记录的单个栏位
 * 如果数据库中超过一条记录则根据fetchIdx取
 * @author kdyi
 *
 */
public class XDynamicDataSource extends XDataSource {

	public XDynamicDataSource(String identityName, IData identityVal,
			Serializable serializableIdentity) {
		super(identityName, identityVal, serializableIdentity);
		// TODO Auto-generated constructor stub
	}
	public XDynamicDataSource(String identityName, IData identityVal) {
		super(identityName, identityVal);
		// TODO Auto-generated constructor stub
	}
	public XDynamicDataSource(String identityName,
			Serializable serializableIdentity) {
		super(identityName, serializableIdentity);
		// TODO Auto-generated constructor stub
	}
	/**
	 *  如果数据库中超过一条记录则取的记录索引
	 *  0: 第一条
	 *  n:　第N条
	 *  -1:最后一条
	 */
	private int fetchIdx = 0;
	private String entity;
	private String valueProp;
	private String criteriaProp;
	private Object criteriaValue;
	private Class criteriaVlaueType;
	private Object data;
	
	public String getEntity() {
		return entity;
	}
	public void setEntity(String entity) {
		this.entity = entity;
	}
	public String getValueProp() {
		return valueProp;
	}
	public void setValueProp(String valueProp) {
		this.valueProp = valueProp;
	}
	public String getCriteriaProp() {
		return criteriaProp;
	}
	public void setCriteriaProp(String criteriaProp) {
		this.criteriaProp = criteriaProp;
	}
	public Object getCriteriaValue() {
		return criteriaValue;
	}
	public void setCriteriaValue(Object criteriaValue) {
		this.criteriaValue = criteriaValue;
	}
	public Class getCriteriaVlaueType() {
		return criteriaVlaueType;
	}
	public void setCriteriaVlaueType(Class criteriaVlaueType) {
		this.criteriaVlaueType = criteriaVlaueType;
	}
	public int getFetchIdx() {
		return fetchIdx;
	}
	public void setFetchIdx(int fetchIdx) {
		this.fetchIdx = fetchIdx;
	}
	public Object getData() {
		return data;
	}
	public void setData(Object data) {
		this.data = data;
	}
}
